package service.Serviceimpl;

import Dao.impl.messageDaoImpl;
import Dao.messageDao;
import domain.message;
import service.messageService;

import java.sql.SQLException;

public class messageServiceImpl implements messageService {
    messageDao messageDao=new messageDaoImpl();
    @Override
    public int count(message message) throws SQLException {
        String sql="SELECT COUNT(t_number) AS count FROM message  WHERE t_number=?";

        return messageDao.count(message,sql);
    }

    @Override
    public void insert(message message) throws SQLException {
        String sql="INSERT INTO `wl18301`.`message` ( `t_time`, `t_ip`, `t_ie`, `T_number`) " +
                " VALUES (?,?,?,?)";
        messageDao.insert(message, sql);
    }


}
